@import "../../styles/popup";

.v-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: $overlay-background-color;
  transition-timing-function: ease;
}

.s-popup {
  position: fixed;
  box-sizing: border-box;
  max-height: 100%;
  overflow-y: auto;
  transition-timing-function: ease;
  animation: ease both;
  -webkit-overflow-scrolling: touch;
  background-color: $color-white;
  &--center {
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);

    &.s-popup--round {
      border-radius: $popup-round-border-radius;
    }
  }

  &--top {
    top: 0;
    left: 0;
    width: 100%;

    &.s-popup--round {
      border-radius: 0 0 $popup-round-border-radius $popup-round-border-radius;
    }
  }

  &--right {
    top: 50%;
    right: 0;
    transform: translate3d(0, -50%, 0);

    &.s-popup--round {
      border-radius: $popup-round-border-radius 0 0 popup-round-border-radius;
    }
  }

  &--bottom {
    bottom: 0;
    left: 0;
    width: 100%;

    &.s-popup--round {
      border-radius: $popup-round-border-radius $popup-round-border-radius 0 0;
    }
  }

  &--left {
    top: 50%;
    left: 0;
    transform: translate3d(0, -50%, 0);

    &.s-popup--round {
      border-radius: 0 $popup-round-border-radius $popup-round-border-radius 0;
    }
  }

  &--bottom {
    &.s-popup--safe {
      padding-bottom: constant(safe-area-inset-bottom);
      padding-bottom: env(safe-area-inset-bottom);
    }
  }

  &--safeTop {
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
  }
}

.s-scale-enter-active,
.s-scale-leave-active {
  transition-property: opacity, transform;
}

.s-scale-enter,
.s-scale-leave-to {
  transform: translate3d(-50%, -50%, 0) scale(0.7);
  opacity: 0;
}

.s-fade-enter-active,
.s-fade-leave-active {
  transition-property: opacity;
}

.s-fade-enter,
.s-fade-leave-to {
  opacity: 0;
}

.s-center-enter-active,
.s-center-leave-active {
  transition-property: opacity;
}

.s-center-enter,
.s-center-leave-to {
  opacity: 0;
}

.s-bottom-enter-active,
.s-bottom-leave-active,
.s-top-enter-active,
.s-top-leave-active,
.s-left-enter-active,
.s-left-leave-active,
.s-right-enter-active,
.s-right-leave-active {
  transition-property: transform;
}

.s-bottom-enter,
.s-bottom-leave-to {
  transform: translate3d(0, 100%, 0);
}

.s-top-enter,
.s-top-leave-to {
  transform: translate3d(0, -100%, 0);
}

.s-left-enter,
.s-left-leave-to {
  transform: translate3d(-100%, -50%, 0);
}

.s-right-enter,
.s-right-leave-to {
  transform: translate3d(100%, -50%, 0);
}
